home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / InitCD < prev    next >
AmigaDOS Script File  |  1998-03-19  |  6KB  |  190 lines

  1. .key arg
  2. .bra {
  3. .ket }
  4.  
  5. ; CUCD Init Script
  6. ;
  7. ; Set up assigns etc. both for users booting from the CD and from  HD
  8. ;
  9. ; Version 1.1 - Changed jpegtmp
  10. ;
  11. ; Version 1.2 - Added uninit option
  12. ;
  13. ; Version 1.3 - Added CHECK argument and link to Prefs editor
  14. ;
  15. ; Version 1.4 - Added section to copy CUCDfile and IDer.prefs to hard drive if not already present
  16.  
  17. Assign CUCD: :
  18.  
  19. ;;; Make some commands resident to speed up things on CD32s in particular
  20. Resident >NIL: CUCD:C/RequestChoice PURE
  21. Resident >NIL: CUCD:rexxc/rx PURE
  22. Resident >NIL: CUCD:C/Version PURE
  23. ;;;
  24. ;;; Exit if InitCD has been run, otherwise ask
  25. If {arg} EQ "CHECK"
  26.     If $CDInit EQ TRUE
  27.         Skip END
  28.     Else
  29.         set init `CUCD:C/RequestChoice "CU Amiga CD" "InitCD needs to be run first*NWould you like to run it now?" "Yes|No"`
  30.         If $init EQ 0
  31.             Skip END
  32.             EndIf
  33.         EndIf
  34.     EndIf
  35. ;;;
  36. ;;; Give option to run UninitCD
  37. If $CDInit EQ TRUE
  38.     If $CDBoot EQ TRUE          ; don't run UninitCD if booted from CD
  39.         CUCD:C/RequestChoice >NIL: "CU Amiga CD" "You do not need to run InitCD*Nwhen you have booted from the CD" "OK" 
  40.         Skip END
  41.         EndIf
  42.     set remass `CUCD:C/RequestChoice "InitCD" "You have already run InitCD once.*NDo you wish to remove the assigns and paths added before?" "Remove|Cancel"`
  43.     If $remass EQ 1
  44.         execute UnInitCD
  45.         EndIf
  46.     Skip END
  47.     EndIf
  48. ;;;
  49. ;;; Set some system assigns and paths
  50. Assign WWW:             CUCD:CUCD/WWW
  51. Assign tcpdldir:        CUCD:CUCD/WWW
  52. Assign GM:              CUCD:CDsupport/GMPlay ADD
  53. Assign CUCDNews:        CUCD:CUCD/Online/News
  54. Assign Twist:           CUCD:CUCD/Magazine/Issues
  55. Assign TwistIcon:       Twist:Icons
  56. Path GM: ADD
  57. ;;;
  58. ;;; Add MUI if no MUI installed.
  59. Assign MUI: EXISTS >NIL:
  60. IF WARN
  61.     Assign MUI:    CUCD:CDsupport/MUI
  62.     Assign Libs:   MUI:Libs ADD
  63.     Assign LOCALE: MUI:Locale ADD
  64.     Assign HELP: exists >NIL:
  65.     If NOT WARN
  66.         Dir >NIL: HELP:
  67.         EndIf
  68.     Assign HELP:   MUI:Docs ADD
  69. Else
  70.     :C/UpdateCopy >NIL: CUCD:CDsupport/MUI/Libs/MUI/Icon.mcc MUI:Libs/MUI CLONE DEEP
  71.     EndIf
  72. ;;;
  73. ;;; Set assigns and paths for programs on this CD
  74. Execute CUCD:S/ThisCD
  75. ;;;
  76. ;;;BEGIN ClassAct
  77. CUCD:C/CAPrefs >NIL:
  78. ;;;END ClassAct
  79. ;;; Commands to be run only if booting from CD
  80. IF $CDBoot EQ TRUE
  81.     Run <NIL: >NIL: C:NewIcons
  82.     CUCD:C/DefIcons
  83.  
  84.     ; Run these only if booting from a real CD32
  85.     Version >NIL:
  86.     if $kickstart EQ "40.60"
  87.         ;C:CD2XSpeed
  88.         C:NoReset
  89.         endif
  90.  
  91.     ; Allow alternative screenmodes
  92.     if $CUCDscreen EQ "NTSC"
  93.         :Storage/Monitors/NTSC
  94.         :Prefs/ScreenMode from :Prefs/Presets/NTSC USE
  95.         :Prefs/Input from :Prefs/Presets/USkey USE
  96.         setenv VisageOpts MONITOR=NTSC
  97.         endif
  98.     if $CUCDscreen EQ "VGA"
  99.         :Storage/Monitors/DblPAL
  100.         :Prefs/ScreenMode from :Prefs/Presets/VGA USE
  101.         setenv VisageOpts MONITOR=DblPAL
  102.         endif
  103.     unsetenv CUCDscreen
  104. ;;;
  105. ;;; All this is only needed when not booting from the CD
  106. Else
  107.     ; Start arexx if not running
  108.     CUCD:rexxc/rx "address command" >NIL:
  109.     If WARN
  110.         CUCD:System/RexxMast >NIL:
  111.         EndIf
  112.     ; Give option for setting CD preferences, make sure CUCDfile and IDer
  113.     ; are in basic command path, so it will run without InitCD
  114. ;    which >NIL: CUCDfile
  115. ;    if WARN
  116.         :C/UpdateCopy >NIL: CUCD:C/CUCDfile C: CLONE
  117. ;        EndIf
  118. ;    which >NIL: IDer
  119. ;    if WARN
  120.         :C/UpdateCopy >NIL: CUCD:C/IDer C: CLONE
  121. ;        EndIf
  122.     ; ensure IDer.prefs are available
  123.     If NOT EXISTS ENV:IDer.prefs
  124.         If NOT EXISTS S:IDer.prefs
  125.             Version >NIL: version 39
  126.             If NOT WARN
  127.                 Copy >NIL: CUCD:S/IDer.prefs S:IDer.prefs
  128.                 set edit `RequestChoice "CU Amiga CD" "CUCD now has a preferences program to specify*N the tools used to view/hear different types of files.*NWould you like to run it now?" "Yes|No"`
  129.                 If $edit EQ 1
  130.                     cd CUCD:S
  131.                     :RexxC/MuiRexx CUCDPrefs.mrx port CDPREFS
  132.                 Else
  133.                     RequestChoice >NIL: "CU Amiga CD" "You can run CUCD preferences at any time.*NIt is in the Prefs drawer of the CD" "OK"
  134.                     EndIf
  135.             Else
  136.                 Copy >NIL: CUCD:S/IDer.prefs_OS2 ENV:IDer.prefs
  137.                 EndIf
  138.             EndIf
  139.         EndIf
  140.  
  141.     Run >NIL: RequestChoice "InitCD" "Setting up some assigns and paths to run software from the CD.*NIf you wish to remove the CD from the drive, run InitCD again,*Notherwise the icon will stay on the Workbench." " OK "
  142.     Assign DEVS:    CUCD:Devs ADD
  143.     Assign Fonts:   CUCD:Fonts ADD
  144.     Assign Libs:    CUCD:Libs ADD
  145.     Assign L:       CUCD:L ADD
  146.     Assign S:       CUCD:S ADD
  147.     Assign LIBS:    CUCD:Classes ADD
  148.     Path CUCD:C CUCD:CDsupport CUCD:System CUCD:Utilities CUCD:S CUCD:Rexxc ADD
  149.  
  150.     ; Make environment variables defined on CD available to system
  151.     Failat 21
  152.     Assign >NIL: ENV: CUCD:Prefs/Env-Archive ADD
  153.     ; For HappyENV users
  154.     If FAIL     
  155.         Assign >NIL: ENVARC: CUCD:Prefs/Env-Archive ADD
  156.         EndIf
  157.  
  158.     ;Start NewIcons if not already running
  159.     If $NoNewIcons NOT EQ TRUE
  160.         CUCD:C/isnirunning
  161.         If NOT WARN
  162.             Run <NIL: >NIL: CUCD:C/NewIcons
  163.             CUCD:C/DefIcons
  164.             EndIf
  165.         EndIf
  166.  
  167.     ; Update workbench paths unless running Directory Opus 5.11 or 5.5 in WBR mode
  168.     Version >NIL: C:LoadWB 43
  169.     If WARN
  170.        C:LoadWB NEWPATH
  171.     Else
  172.         Version >NIL: C:LoadWB 60
  173.         If NOT WARN
  174.             C:LoadWB NEWPATH
  175.             EndIf
  176.         EndIf
  177.  
  178.  
  179.     EndIf
  180. ;;;
  181. SetEnv CDInit TRUE
  182.  
  183. LAB END
  184.  
  185. ;;; Remove commands made resident earlier
  186. Resident >NIL: RequestChoice REMOVE
  187. Resident >NIL: rx REMOVE
  188. Resident >NIL: Version REMOVE
  189. ;;;
  190.